<?php

/**
 * 
 *
 * @version $Id: list_news.inc.php,v 1.6 2005/01/03 13:41:30 phppc Exp $
 * @copyright 2004 
 **/

if(!isset($_GET["page"])) $_GET["page"] = 1;
$anzahl_gesamt = $this->db_anzahl_zeilen("SELECT news_id FROM ".$this->config["prefix"]."main");
$per_page = 20;
list($start,$page_nav) = $this->fun_nav_page_creator($anzahl_gesamt,$per_page,$_GET["page"],5,0,"&action=list_news",0,"page",$file = "admin.php");
$erg = $this->db_abfrage_q ("SELECT * FROM ".$this->config["prefix"]."main ORDER BY news_id DESC LIMIT $start,$per_page");
$list_ones = "";
while($db_news = $this->db_abfrage_fetch($erg)){
	$db_news["n_title"] = stripslashes($db_news["n_title"]);
	list($start_date,$start_time) = $this->fun_tstamp2date($db_news["time_start"]);
	if($db_news["time_end"] > 0) list($end_date,$end_time) = $this->fun_tstamp2date($db_news["time_end"]);
	else {
		$end_date = "";
		$end_time = "";
	}
	$edit_link = $this->fun_make_link("admin.php","action=news&news=edit&news_id=".$db_news["news_id"]."");
	$this->tpl_load("list_news_one","admin/");
	$this->tpl_replace_vars(array("n_title" => $db_news["n_title"],"start_date" => $start_date,"start_time" => $start_time,"end_date" => $end_date, "end_time" => $end_time, "time_end" => $db_news["time_end"], "edit_link" => $edit_link));
	$list_ones .= $this->tpl_output();
	unset($start_date,$start_time,$end_date,$end_time,$use_end);
} // while
$this->tpl_load("list_news","admin/");
$this->tpl_replace_vars(array("list_ones" => $list_ones));
$nc_main = $this->tpl_output();
$help_id = 1;
$nc_box["admin_list_news_pagenav"] = $page_nav;


?>